package com.ask.forMe.mapper;

import com.ask.forMe.model.entity.Rating;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RatingMapper extends BaseMapper<Rating> {
    /**
     * 获取用户评分过的商品id
     * @param userId
     * @return
     */
    @Select("select item_id from rating where user_id = #{userId}")
    List<Long> getItemIdByUserId(Long userId);
}
